<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
  <link type="text/css" href="/static/css/ui-lightness/jquery-ui-1.8.12.custom.css" rel="stylesheet" />
  <link type="text/css" href="/static/css/default.css" rel="stylesheet" />	
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script>
  <script src="/static/js/jquery.transform.js" type="text/javascript"></script>  
  <script src="/static/js/jquerytmpl.js" type="text/javascript"></script>
  <script src="/static/js/tinyxmlsax.js" type="text/javascript"></script>
  <script src="/static/js/tinyxmldom.js" type="text/javascript"></script>
  <script src="/static/js/tinyxmlw3cdom.js" type="text/javascript"></script>
  <script type="text/javascript" src="/static/js/jquery-ui-1.8.12.custom.min.js"></script>
  <script type="text/javascript" src="/static/js/vanadium-min.js"></script>
  <script src="/static/js/functions.js" type="text/javascript"></script>  

</head>
<body>
<script id="list_packagesTemplate" type="text/x-jquery-tmpl">
    <tr>
      <td class="highlightpackage${key}"><a href="#" onclick="return show_package(${key});">${name}</a><br/>${desc}</td>
      <td class="highlightpackage${key}"><a href="#" onclick="return delete_package(${key});"><img alt="delete" src="images/delete.png"/></a></td>
    </tr>
</script>

<script id="add_interactionTemplate" type="text/x-jquery-tmpl">
  
</script>



<script id="show_toolTemplate" type="text/x-jquery-tmpl">
  <div id="edittoolform">
    <form id="show_tool_form" onsubmit="return false;">
      <h1>Tool Editor</h1>
      Name <input type="text" name="name" value="${name}"/>
      <input type="hidden" name="id" value="${key}"/>
      <input type="hidden" id="toolcontentstext" name="contents" value="${contents}"/>
    </form>
    <hr/>
    <form id="add_interaction_form" onsubmit="return false;">
    <p>Add Interaction: 
      <select name="interactiontype" id="interactiontype" onchange="interactionselected()">
        <option value="">Select one</option>
        <!--<option value="Instructions">Instructions</option> -->
        <option value="choiceInteraction">Multiple Choice</option>
        <option value="uploadInteraction">Photo/Video</option>
        <option value="textEntryInteraction">Text Entry</option>
      </select>
    </p>
    </form> 
    <div id="interactionsparent">
      <form id="InstructionsForm" class="hidden" onsubmit="return processInstructionsForm();">
        <textarea name="thingy" id="thingy" class=":required"></textarea>
        <input type="submit" value="add"/>
      </form>
      <form id="choiceInteractionForm" class="hidden" onsubmit="return processchoiceInteractionForm()">
        Prompt: <input name="prompt" type="text" value="" class=":required"/><br/>
        <div id="choiceoptions">
          Choices<br/>
          <input type="button" value="add another choice" onclick="addamultiplechoice()"><br/>
          <input name="choice" type="text" value="" class=":required"/><br/>
          <input name="choice" type="text" value="" class=":required"/><br/>
        </div>
        <input type="submit" value="add">
      </form>
      <form id="uploadInteractionForm" class="hidden" onsubmit="return processuploadInteractionForm();">
        Prompt: <input name="prompt" type="text" value="" class=":required"/><br/>
        <input type="submit" value="add">
      </form>
      <form id="textEntryInteractionForm" class="hidden" onsubmit="return processtextEntryInteractionForm();">
        Prompt: <input name="prompt" type="text" value="" class=":required"/><br/>
        <input type="submit" value="add">
      </form>
    </div>

    
    <hr/>
    <div class="bottom-aligned">
      <input type="button" value="Save" onclick="save_tool();"/>
      <input type="button" value="Close" onclick="cancel_tool();"/>
    </div>
  </div>
  <div id="contentviewerframe">
    <h1>Tool Preview</h1>
    <div id="contentviewer"></div>
  <div>
    
</script>

<script id="show_packageTemplate" type="text/x-jquery-tmpl">
    <h1>Package Editor</h1>
    <p>${name}</p>
    <input type="button" value="Add Tool" onclick="$('#create_tool_form').dialog({modal:true, title:'New Assessment Tool', height:350, width:550});"/>
    <input type="button" value="Download" onclick="window.open( 'http://' + location.host + '/down/${key}/','download');" >
    <div id="list_tools_scroller">
      <table id="list_tools">
      {{each tools}}
        <tr><td class="highlighttool${key}"><a href="#" onclick="return show_tool(${key});">${name}</a></td><td class="highlighttool${key}"><a href="#" onclick="return delete_tool(${key});"><img alt="delete" src="images/delete.png"/></a></td></tr>
      {{/each}}
      </table>
    </div>
    <form id="create_tool_form" onsubmit="return create_tool(${key});" class="hidden" autocomplete="off">
      <input type="hidden" name="id" value="${key}"/>
      Name: <input type="text" name="name" id="tool_name" value="" class=":required"/><br/>
      Order: <select name="theorder">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>
      </select>
      <div class="bottom-aligned">
        <input type="submit" value="Add"/>
        <input type="button" value="Cancel" onclick="$('#create_tool_form').dialog('destroy');"/>
      </div>
    </form>
    
    
</script>

<div id="maincontent">
  <div id="package_div">
    <h1>Assessment Packages</h1>
    <input type="button" value="Add Package" onclick="$('#create_package_form').dialog({modal:true,  title:'Create Assessment Package', height:350, width:550});"/>
    <div id="list_packages_scroller">
      <table id="list_packages"></table>
    </div>
    <form id="create_package_form" onsubmit="return create_package();" class="hidden" autocomplete="off">
    Name: <input type="text" name="name" id="package_name" class=":required"/></br>
    Desc: <textarea name="desc" id="package_desc" class=":required"></textarea></br>
    <div class="bottom-aligned">
      <input type="submit" value="Add"/>
      <input type="button" value="Cancel" onclick="$('#create_package_form').dialog('destroy');"/>
    </div>
    </form>
  </div>
  <div id="show_package" class="hidden"></div>
  <div id="show_tool" class="hidden"></div>
</div>
</body>
</html>